<template>
  <div class="tab-content group-class-report">
    <BasicCard style="margin-bottom: 20px">
      <BasicVxeTable ref="gridRef" v-bind="gridOption"> </BasicVxeTable>
    </BasicCard>
  </div>
</template>

<script setup lang="ts">
  import { valueZhuaneFloat, splitTsIdToTime } from '@/utils/custom/index'
  import {
    postLuoTongFenZhuTongJi_CiLaiFu
    // getwuLiaoAndJiTai,
    // postLuoTongZhengJiFenXiQuShiTu,
    // getLuoTongZongLianCanShuJi,
    // getLuoTongZhengJiShuJuFenLei,
    // getZiDingYiBaoBiaos
  } from '@/api/shengChanJianShi'

  const { t } = useI18n()
  // const url = window.location.href
  const gridOption = reactive<BasicGridProps>({
    extraConfig: {
      title: t('custom.分组数据'),
      isCustom: false,
      isExport: true,
      isFilterAndSort: true
    }, // 拓展的配置
    id: `group-class-report-table`, // id用于缓存,务必配置
    toolbarConfig: {}, // 工具栏
    // exportConfig: {
    //   filename: '数据表'
    // }
    loading: true
    // height: '100%',
  })

  const getList = () => {
    postLuoTongFenZhuTongJi_CiLaiFu({
      machineDocumentIds: [
        '75fecdf6-977a-73d0-4780-3a07f8bb5b28',
        '99647190-f3e0-6786-f633-3a07f8be361e',
        '30b3aab1-2d26-ab16-2ac5-3a07f8be3760',
        'a76ae8ce-2d09-7f17-64c0-3a07f8be385a',
        '511819df-0c33-228d-8d98-3a07f8be38cc',
        'c327c950-37ca-e957-d4ee-3a07f8be3a60',
        'b72dad0d-0c7c-8ae0-e561-3a07f8be3b4d',
        '92694083-6d51-8d09-441a-3a07f8be3bcc',
        '4f00ff72-cba8-9f90-a834-3a07f8be3c4e',
        'b2cb1853-f3a0-badf-e127-3a07f8be3d53',
        '2045ac1a-b3e4-772a-f4d6-3a07f8be3df9',
        'e5ae148a-0480-1a68-261a-3a07f8be3ec5',
        '50b4c32d-8b67-23cf-23c6-3a07f8be3f71',
        'da610ebf-ab5a-cb57-0aa0-3a07f8be3ff2',
        '4452642b-e927-cb80-75d8-3a07f8be4108',
        '2400a079-7826-528d-8f43-3a07f8be419a',
        'f487ff0d-4f69-03a6-710f-3a07f8be4249',
        '7e07254d-05a0-6fee-c458-3a07f8be436a',
        '8f4973e6-238f-7c2f-3740-3a07f8be4444',
        'bff5c9e7-6b2f-b972-759d-3a07f8be45a7',
        '1b75eb95-eeb7-3d72-c4d1-3a07f8be47dc',
        'b5546dc8-38e5-f773-bb9f-3a07f8be491e',
        '46426768-a790-ebb9-44b4-3a07f8be4e91',
        '21497760-364b-3d31-fc0d-3a07f8be4f66',
        '7d8a8321-f0a7-de3e-e86f-3a07f8be4fde',
        '0b2af772-5f41-9535-2766-3a07f8be504e',
        '55d2e5bd-7ee3-e237-8685-3a07f8be5115',
        '96da7b3b-b2db-5bd4-a8ae-3a07f8be51d8',
        '9b4b5074-d2ef-30b8-4627-3a07f8be528c',
        'd0167f76-a921-ae7a-04b1-3a07f8be5323',
        '531bb619-1380-c86f-b28b-3a07f8be53d5',
        'fdf5a690-f887-5596-8905-3a07f8be550f',
        'e8d836d7-3c54-23a0-3f13-3a07f8be55f0',
        'c67d233f-14ee-35b1-50b5-3a07f8be5686',
        '10582e68-6961-0d96-4bee-3a07f8be5732',
        '94503288-ae6a-d72e-0324-3a07f8be5853',
        '2252aa80-cddf-dc7b-b078-3a07f8be5914',
        '229b7da1-818c-f762-ff48-3a07f8be599f',
        '303322b1-5a67-f640-c6c6-3a07f8be5a60',
        'c730070d-0ad9-8758-0068-3a07f8be5b95',
        '462f265e-423e-9938-a335-3a07f8be6205',
        '4a5fd1d0-26f6-dbef-dc31-3a07f8be629c',
        '6494e73b-6f86-989f-1bec-3a07f8be6387',
        '22e091a8-3920-a661-54dc-3a07f8be6404',
        '3426602e-c187-9456-3239-3a07f8be650e',
        '9a57a7f1-668a-b088-545c-3a07f8be65e4',
        '82a1dcf9-bc45-a38f-2773-3a07f8be6699',
        'd4254634-667d-5f3a-d307-3a07f8be6761',
        '313fa3ce-e4d4-7dad-eb1a-3a07f8be6853',
        'f9abc705-c57d-24de-aacd-3a07f8be6ce3',
        '891063c5-8ac1-7e71-3065-3a07f8be6da0',
        '812f6c54-2a76-1355-b7bc-3a07f8be49ea',
        '8e597494-b4fd-58c3-ad84-3a07f8be4a56',
        '4ae119a9-9ae6-f842-64ff-3a07f8be4b6a',
        '2cae0c7c-3723-e5e5-a746-3a07f8be4c10',
        '00f7101d-0b8c-6611-e561-3a07f8be4cd9',
        '1005c3ff-a653-630d-f44a-3a07f8be4d8f',
        '8297a573-a297-7f8b-d3cf-3a07f8be4dcf',
        '81f3c898-6317-bc43-b12b-3a07f8be577e',
        'd73d40e7-6cfb-c7ea-78c6-3a07f8be57fd',
        '966ea1c8-f1a9-04ac-485c-3a07f8be5c4c',
        'd6532b01-1fcf-7177-60f6-3a07f8be5d23',
        '5c413ba0-d4c0-1d37-6485-3a07f8be5dd8',
        'c612c7f0-947b-87e1-920d-3a07f8be5e83',
        'cbbff171-296a-b4da-3cc1-3a07f8be5fba',
        '6318bbf8-076c-c591-01a8-3a07f8be6065',
        '194cc23f-a2dc-c23a-c5c2-3a07f8be60d9',
        'b9278620-9301-7de5-1e73-3a07f8be6182',
        'f1b71c83-92a9-f1fc-ad23-3a07f8be690f',
        'f8c2e86f-f87e-9207-9537-3a07f8be699e',
        '6fa91607-65f0-e705-6237-3a07f8be6b04',
        'f8f794d1-92dc-5379-612e-3a07f8be6ba7'
      ],
      customReportId: '',
      tsIdStart: 25071602,
      tsIdEnd: 25071602
    }).then((res: any) => {
      gridOption.loading = false
      const arr: any = []
      res.machineHtGroupLts[0].params.forEach((val) => {
        if (val.isShowWeb === true) {
          arr.push({
            title: val.name,
            field: val.code,
            minWidth: 70
          })
        }
      })
      gridOption.columns = [
        {
          title: '机台号#组号',
          field: 'machineSpindleNo',
          minWidth: 80,
          fixed: 'left'
        },
        {
          title: '班次',
          field: 'banCi',
          minWidth: 120,
          fixed: 'left'
        },
        ...arr
      ]
      // this.canShuList = res.machineHtGroupLts[0].params
      // this.canShuID = this.canShuList[0].code
      res.machineHtGroupLts[0].data.sort((a, b) => {
        return a.machineName - b.machineName
      })
      res.machineHtGroupLts[0].data.forEach((val) => {
        valueZhuaneFloat(val)
        val.banCi = splitTsIdToTime(val.TsId) + val.ShiftName
        val.machineSpindleNo = val.MachineName + '#' + val.GroupNo
      })
      gridOption.data = res.machineHtGroupLts[0].data
    })
  }

  onMounted(() => {
    getList()
  })
</script>
<style scoped lang="scss"></style>
